package com.fita.entity.order.reverse;

/**
 * @description:
 * @author: 11200
 * @date: 2019/8/22
 */
public enum ReverseOrderStatus {

    EDITING("编辑中"),

    UNPAID("待支付"),

    WAITING_FOR_TICKET("待出票"),

    TICKETED("已出票"),

    WAITING_FOR_REFUND("待退款"),

    CANCELED("已取消"),

    CONSUMED("已核销");


    private String description;

    ReverseOrderStatus(String description) {
        this.description = description;
    }

    public boolean canShowPaidTime(){
        if (this.equals(WAITING_FOR_TICKET) || this.equals(TICKETED) || this.equals(WAITING_FOR_REFUND)){
            return true;
        }
        return false;
    }

    public boolean canShowCancelTime(){
        if (this.equals(WAITING_FOR_REFUND) || this.equals(CANCELED) || this.equals(CONSUMED)){
            return true;
        }
        return false;
    }

    /**
     * 是否能显示修改预定按钮
     * @return
     */
    public boolean canEditBook(){
        if (this.equals(EDITING) || this.equals(UNPAID) || this.equals(TICKETED) || this.equals(WAITING_FOR_TICKET)){
            return true;
        }
        return false;
    }

    /**
     * 是否显示修改客户信息按钮
     * @return
     */
    public boolean canEditCustomInfo(){
        if (this.equals(EDITING)){
            return true;
        }
        return false;
    }

    public boolean canEditPassengerInfo(){
        if (this.equals(EDITING) || this.equals(UNPAID) || this.equals(WAITING_FOR_TICKET) || this.equals(TICKETED)){
            return true;
        }
        return false;
    }

    /**
     * 是否显示修改价格按钮
     * @return
     */
    public boolean canEditPrice(){
        if (this.equals(EDITING) || this.equals(UNPAID)){
            return true;
        }
        return false;
    }

    /**
     * 是否完成
     * @return
     */
    public boolean isFinish(){
        return this.isConsumed() || this.isCanceled() || this.isWaitingForRefund();
    }

    /**
     *
     * @return
     */
    public boolean isEditing(){
        return this.equals(EDITING);
    }

    /**
     *
     * @return
     */
    public boolean isUnpaid(){
        return this.equals(UNPAID);
    }

    /**
     *
     * @return
     */
    public boolean isWaitingForTicket(){
        return this.equals(WAITING_FOR_TICKET);
    }

    /**
     *
     * @return
     */
    public boolean isTicketed(){
        return this.equals(TICKETED);
    }

    /**
     *
     * @return
     */
    public boolean isWaitingForRefund(){
        return this.equals(WAITING_FOR_REFUND);
    }

    /**
     *
     * @return
     */
    public boolean isCanceled(){
        return this.equals(CANCELED);
    }

    /**
     *
     * @return
     */
    public boolean isConsumed(){
        return this.equals(CONSUMED);
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
}
